package com.qch.docker.docker_demo.controller;

import com.qch.docker.docker_demo.pojo.GoodDO;
import com.qch.docker.docker_demo.repositry.GoodsRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author qch
 * @Date 2021/6/23
 */
@RestController
@RequestMapping("/good")
public class GoodController {
    @Autowired
    private GoodsRepository repository;
    /*@RequestMapping("/list")
    public ModelAndView list() {
        ModelAndView view = new ModelAndView("/goods");
        List<GoodDO> list = repository.findAll();
        view.addObject("userId", UUID.randomUUID().toString().replace("-",""));
        view.addObject("list", list);
        return view;
    }*/
    @GetMapping("/list")
    public List<GoodDO> queryGoods() {
        return repository.findAll(); }
}
